﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebStudio.Business.Entity;
using WebStudio.Business.Rule;

public partial class ProductDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            rptProductDtlBind();
            getPageTitle();
        }
    }

    private int AlbumId
    {
        get
        {
            if (string.IsNullOrEmpty(Request.QueryString["aid"]))
            {
                return 0;
            }
            else
            {
                int PID = 0;
                try
                {
                    PID = Convert.ToInt32(Request.QueryString["aid"]);
                }
                catch
                {
                    return 0;
                }
                return PID;
            }
        }
    }

    private void rptProductDtlBind()
    {
        rptProductDtl.DataSource = PhotoRule.GetPhotoList("AlbumId=" + AlbumId + "");
        rptProductDtl.DataBind();
    }

    private void getPageTitle()
    {
        AlbumEntity albumEntity = new AlbumEntity();
        albumEntity = AlbumRule.GetAlbumEntity(AlbumId);
        this.Title = albumEntity.AlbumName;
    }
}
